"use strict"
/**
 *
 * @param {import("egg").Application} app
 */
module.exports = app => {
	const Sequelize = app.Sequelize
	const sequelize = app.model
	let ads = sequelize.define("ads", {
		aid: {
			type: Sequelize.STRING,
			comment: "所属的应用"
		},
		type: {
			type: Sequelize.TINYINT,
			comment: "广告类型：1官方广告，2第三方广告"
		},
		ad_id: {
			type: Sequelize.STRING,
			comment: "广告id",
		},
		show_type: {
			type: Sequelize.TINYINT,
			comment: " 微信广告类型：1视频广告，2banner广告"
		},
		key: {
			type: Sequelize.STRING,
			comment: "自定义keys"
		},
		app_id: {
			type: Sequelize.STRING,
			comment: "appid"
		},
		title: {
			type: Sequelize.STRING,
			comment: "标题"
		},
		link: {
			type: Sequelize.STRING,
			comment: "链接"
		},
		remarks: {
			type: Sequelize.STRING,
			comment: "备注"
		},
		image_url: {
			type: Sequelize.STRING,
			comment: "链接url"
		},
		position: {
			type: Sequelize.STRING,
			comment: "显示位置"
		},
		stat: {
			type: Sequelize.TINYINT
		},
		share_img: {
			type: Sequelize.STRING,
			comment: "分享图"
		}
	}, {timestamps: false})
	// ads.beforeFind
	// ads.sync({alter: true})
	return ads
}